# $Id$
# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgbase=python-cson
pkgname=(python-cson python2-cson)
pkgver=0.7
pkgrel=1
pkgdesc="A Python parser for Coffeescript Object Notation (CSON)"
arch=('any')
url="https://github.com/avakar/pycson"
license=('MIT')
makedepends=('git'
             'python-setuptools'
             'python2-setuptools'
             'python-speg'
             'python2-speg')
source=("git://github.com/avakar/pycson.git#tag=${pkgver}")
sha256sums=(SKIP)

check() {
  cd "$srcdir"/pycson
  python test.py
  python2 test.py
}

package_python2-cson() {
  depends=('python2' 'python2-six' 'python2-speg')

  cd "$srcdir"/pycson
  python2 setup.py install --root="${pkgdir}"
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_python-cson() {
  depends=('python' 'python-six' 'python-speg')

  cd "$srcdir"/pycson
  python setup.py install --root="${pkgdir}"
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
